Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text

Namespace C4F.DevKit.Calendar
	''' <summary>
	''' A class which represents a reminder for an appointment.
	''' </summary>
	Public Class Reminder
		#Region "Private Members"

		Private _UID As Guid

		Private _triggerSpan As TimeSpan

		Private _triggerDate As DateTime

		Private _isAbsolute As Boolean

		Private _extraProperties As List(Of String)


		#End Region

		#Region "Public Constructors"

		''' <summary>
		''' Creates a new Reminder.
		''' </summary>
		Public Sub New()
			_UID = Guid.NewGuid()
			ExtraProperties = New List(Of String)()
		End Sub

		#End Region

		#Region "Internal Properties"

		Friend Property ExtraProperties() As List(Of String)
			Get
				Return _extraProperties
			End Get
			Set(ByVal value As List(Of String))
				_extraProperties = value
			End Set
		End Property

		#End Region

		#Region "Public Properties"

		''' <summary>
		''' The amount of time before the event that the reminder is triggered.
		''' </summary>
		Public Property Trigger() As TimeSpan
			Get
				Return _triggerSpan
			End Get

			Set(ByVal value As TimeSpan)
				_triggerSpan = value
				_isAbsolute = False
			End Set
		End Property

		''' <summary>
		''' The date on which the reminder should be triggered.
		''' </summary>
		Public Property OnDateTrigger() As DateTime
			Get
				Return _triggerDate
			End Get

			Set(ByVal value As DateTime)
				_triggerDate = value
				_isAbsolute = True
			End Set
		End Property

		''' <summary>
		''' Whether or not this reminder is absolute (goes off at a certain date,
		''' independent of the appointment date), or relative (goes off at a time
		''' relative to the start of the appointment).
		''' </summary>
		Public ReadOnly Property IsAbsoluteTrigger() As Boolean
			Get
				Return _isAbsolute
			End Get
		End Property

		''' <summary>
		''' The unique identifier for the alarm.
		''' </summary>
		Public ReadOnly Property UID() As Guid
			Get
				Return _UID
			End Get
		End Property

		#End Region

		#Region "Internal Methods"

		Friend Sub SetUID(ByVal uid As Guid)
			_UID = uid
		End Sub

		#End Region
	End Class
End Namespace
